<html>
 <head>
  <link href="./leetcode-problem.css" rel="stylesheet" type="text/css">
 </head>
 <body>
  <div class="question_difficulty">
   难度：Medium
  </div>
  <div>
   <h1 class="question_title">
    540. Single Element in a Sorted Array
   </h1>
   <p>
    Given a sorted array consisting of only integers where every element appears twice except for one element which appears once. Find this single element that appears only once.
   </p>
   <p>
    <b>
     Example 1:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> [1,1,2,3,3,4,4,8,8]
<b>Output:</b> 2
</pre>
   <p>
    <b>
     Example 2:
    </b>
    <br>
   </p>
   <pre>
<b>Input:</b> [3,3,7,7,10,11,11]
<b>Output:</b> 10
</pre>
   <p>
    <b>
     Note:
    </b>
    Your solution should run in O(log n) time and O(1) space.
   </p>
  </div>
  <div>
   <h1 class="question_title">
    540. 有序数组中的单一元素
   </h1>
   <p>
    给定一个只包含整数的有序数组，每个元素都会出现两次，唯有一个数只会出现一次，找出这个数。
   </p>
   <p>
    <strong>
     示例 1:
    </strong>
   </p>
   <pre>
<strong>输入:</strong> [1,1,2,3,3,4,4,8,8]
<strong>输出:</strong> 2
</pre>
   <p>
    <strong>
     示例 2:
    </strong>
   </p>
   <pre>
<strong>输入:</strong> [3,3,7,7,10,11,11]
<strong>输出:</strong> 10
</pre>
   <p>
    <strong>
     注意:
    </strong>
    您的方案应该在 O(log n)时间复杂度和 O(1)空间复杂度中运行。
   </p>
  </div>
 </body>
</html>